COMPARE for CP/M
version 3.0


This program compares two disk files for equality and lists in case one or
more differences are encountered.

The file pointer for each file starts at 000000h. In case a byte is found not
equal, two file records are displayed in 16*8 table format for each file
(1 record = 128 bytes). The different byte is displayed in reverse video,
both HEX and ASCII format, if byte is printable character. If not, it displays
a "." as ASCII representation.

In case of unequal bytes, the user can decide to continue as is or to advance
the file pointer for each file separately or for both files simultaneously,
in an attempt to (re)synchronize the files.


Syntax:

compare [d:]filenam1.ext [d:]filenam2.ext

Boh filenames must be entered, including the filename extension (if any). The
program does *not* assumes the .COM extension.
Drive is optional. If no drive is specified, the default one is used. The
program displays the default drive as "*".


Version limit:
- the program must run on a Z80 machine or compatible emulator
- the program must run on a CP/M version that knows about terminal emulation
  control codes. Actual codes are for Zenith Z19/Z29 monitor; seems they are
  good for VT52 also.
- maximum file size is 8M (8388608 bytes). Assuming the CP/M version
  environment accepts file size greater than 8M, the program will display an
  error in case an attempt is made.


History:
- COMPARE.COM V2.01 AS OF 28-NOV-79 found on a diskette running CP/M 2.2.
  Author unknown. Maximum file size was 64K. No terminal emulation control
  codes used, a shifted row mechanism used instead, in order to indicate the
  unequal byte. Unequal byte indication was for HEX display only, ASCII
  display was present but not marked as different.
- during July 1999 I disassembled and practically rewritten the program,
  keeping the main idea for table display.
- COMPARE.COM V3.0 considered from now
- giving away 8080 compatibility, Z80 specific instruction used
- changed shifted row marking mechanism with inverse video marking mechanism
- filename is now clearly displayed above each table
- file size & error count is now 24 bit long
- relative table address is now xxxxxxh bytes format (instead of xxxxh) and
  really works (was previously present but inactive)
- many cosmetical adjustments
- beta testing at the date of the current readme file

Known bug:
- when comparing two files of same (record(s)) lenght but different content,
  if moving the pointer forward in one file, the program reports 'eof on file
  n, before file m'; this may lead into confusion


Control codes addresses:
0103h   clears the viewport
0108h   moves the cursor to its home position
010Dh   erases to the bottom of the viewport, including character at current
        position
0112h   moves cursor to a given position; particulary, row 22, col 0
0117h   enters reverse video mode
011Ch   leaves inverse video mode


Disassembled & (re)assembled using HiSoft's Devpac80 for Sinclair Spectrum +3
Using my Sinclair Spectrum +3 hardware compatible machine, with 10 MHz CMOS Z80, overclocked at 14 MHz
Running Locomotive CP/M Plus
Tested also on MYZ80 CP/M emulator V1.11 (C) 1993 Simeon Cran, using VT52 terminal emulation


Cristian Secara
secarica@fx.ro
11.08.1999
